<?php

/**
 * Societe form base class.
 *
 * @method Societe getObject() Returns the current form's model object
 *
 * @package    SdCommerce
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseSocieteForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                                          => new sfWidgetFormInputHidden(),
      'date'                                        => new sfWidgetFormDate(),
      'raison_sociale'                              => new sfWidgetFormInputText(),
      'matricule_fiscale'                           => new sfWidgetFormInputText(),
      'capital'                                     => new sfWidgetFormInputText(),
      'code_t_v_a'                                  => new sfWidgetFormInputText(),
      'telephone'                                   => new sfWidgetFormInputText(),
      'telephone2'                                  => new sfWidgetFormInputText(),
      'fax'                                         => new sfWidgetFormInputText(),
      'email'                                       => new sfWidgetFormInputText(),
      'site_web'                                    => new sfWidgetFormInputText(),
      'timbre'                                      => new sfWidgetFormInputText(),
      'numero_registre_commerce'                    => new sfWidgetFormInputText(),
      'numero_assurance_sociale'                    => new sfWidgetFormInputText(),
      'cle_assurance_sociale'                       => new sfWidgetFormInputText(),
      'logo'                                        => new sfWidgetFormInputText(),
      'nature_societe'                              => new sfWidgetFormInputText(),
      'description'                                 => new sfWidgetFormTextarea(),
      'prefixe_bon_sortie_interne'                  => new sfWidgetFormInputText(),
      'compteur_bon_sortie_interne'                 => new sfWidgetFormInputText(),
      'prefixe_bon_entree_interne'                  => new sfWidgetFormInputText(),
      'compteur_bon_entree_interne'                 => new sfWidgetFormInputText(),
      'prefixe_client'                              => new sfWidgetFormInputText(),
      'prefixe_fournesseur'                         => new sfWidgetFormInputText(),
      'prefixe_devis_client'                        => new sfWidgetFormInputText(),
      'compteur_devis_client'                       => new sfWidgetFormInputText(),
      'prefixe_bon_commande_client'                 => new sfWidgetFormInputText(),
      'compteur_bon_commande_client'                => new sfWidgetFormInputText(),
      'prefixe_bon_livraison_client'                => new sfWidgetFormInputText(),
      'compteur_bon_livraison_client'               => new sfWidgetFormInputText(),
      'prefixe_bon_retour_client'                   => new sfWidgetFormInputText(),
      'compteur_bon_retour_client'                  => new sfWidgetFormInputText(),
      'prefixe_facture_client'                      => new sfWidgetFormInputText(),
      'compteur_facture_client'                     => new sfWidgetFormInputText(),
      'prefixe_facture_retour_client'               => new sfWidgetFormInputText(),
      'compteur_facture_retour_client'              => new sfWidgetFormInputText(),
      'prefixe_preparation_livraison_client'        => new sfWidgetFormInputText(),
      'compteur_preparation_livraison_client'       => new sfWidgetFormInputText(),
      'prefixe_avoir_marchandise_client'            => new sfWidgetFormInputText(),
      'compteur_avoir_marchandise_client'           => new sfWidgetFormInputText(),
      'prefixe_reglement_client'                    => new sfWidgetFormInputText(),
      'compteur_reglement_client'                   => new sfWidgetFormInputText(),
      'prefixe_reglement_fournisseur'               => new sfWidgetFormInputText(),
      'compteur_reglement_fournisseur'              => new sfWidgetFormInputText(),
      'prefixe_bon_sortie_camion'                   => new sfWidgetFormInputText(),
      'compteur_bon_sortie_camion'                  => new sfWidgetFormInputText(),
      'prefixe_bon_retour_camion'                   => new sfWidgetFormInputText(),
      'compteur_bon_retour_camion'                  => new sfWidgetFormInputText(),
      'prefixe_bon_commande_fournisseur'            => new sfWidgetFormInputText(),
      'compteur_bon_commande_fournisseur'           => new sfWidgetFormInputText(),
      'prefixe_bon_retour_fournisseur'              => new sfWidgetFormInputText(),
      'compteur_bon_retour_fournisseur'             => new sfWidgetFormInputText(),
      'prefix_preparation_commande_fournisseur'     => new sfWidgetFormInputText(),
      'compteur_preparation_commande_fournisseur'   => new sfWidgetFormInputText(),
      'prefix_devis_client'                         => new sfWidgetFormInputText(),
      'sequentiel_bon_sortie_interne'               => new sfWidgetFormInputText(),
      'sequentiel_bon_entree_interne'               => new sfWidgetFormInputText(),
      'sequentiel_devis_client'                     => new sfWidgetFormInputText(),
      'sequentiel_bon_commande_client'              => new sfWidgetFormInputText(),
      'sequentiel_bon_livraison_client'             => new sfWidgetFormInputText(),
      'sequentiel_bon_retour_client'                => new sfWidgetFormInputText(),
      'sequentiel_facture_client'                   => new sfWidgetFormInputText(),
      'sequentiel_facture_retour_client'            => new sfWidgetFormInputText(),
      'sequentiel_preparation_livraison_client'     => new sfWidgetFormInputText(),
      'sequentiel_avoir_marchandise_client'         => new sfWidgetFormInputText(),
      'sequentiel_bon_sortie_camion'                => new sfWidgetFormInputText(),
      'sequentiel_bon_retour_camion'                => new sfWidgetFormInputText(),
      'sequentiel_bon_retour_fournisseur'           => new sfWidgetFormInputText(),
      'sequentiel_bon_commande_fournisseur'         => new sfWidgetFormInputText(),
      'sequentiel_preparation_commande_fournisseur' => new sfWidgetFormInputText(),
      'tarification'                                => new sfWidgetFormInputCheckbox(),
      'caisse'                                      => new sfWidgetFormInputCheckbox(),
      'id_categorie_comptable'                      => new sfWidgetFormInputText(),
      'id_forme_juridique'                          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('FormeJuridique'), 'add_empty' => false)),
      'id_nationalite'                              => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Nationalite'), 'add_empty' => false)),
      'id_devise'                                   => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Devise'), 'add_empty' => true)),
      'created_at'                                  => new sfWidgetFormDateTime(),
      'updated_at'                                  => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                                          => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'date'                                        => new sfValidatorDate(),
      'raison_sociale'                              => new sfValidatorString(array('max_length' => 50)),
      'matricule_fiscale'                           => new sfValidatorString(array('max_length' => 20)),
      'capital'                                     => new sfValidatorNumber(),
      'code_t_v_a'                                  => new sfValidatorNumber(),
      'telephone'                                   => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'telephone2'                                  => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'fax'                                         => new sfValidatorString(array('max_length' => 20, 'required' => false)),
      'email'                                       => new sfValidatorString(array('max_length' => 70, 'required' => false)),
      'site_web'                                    => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'timbre'                                      => new sfValidatorNumber(array('required' => false)),
      'numero_registre_commerce'                    => new sfValidatorString(array('max_length' => 30, 'required' => false)),
      'numero_assurance_sociale'                    => new sfValidatorString(array('max_length' => 8, 'required' => false)),
      'cle_assurance_sociale'                       => new sfValidatorString(array('max_length' => 2, 'required' => false)),
      'logo'                                        => new sfValidatorString(array('max_length' => 225, 'required' => false)),
      'nature_societe'                              => new sfValidatorString(array('max_length' => 70, 'required' => false)),
      'description'                                 => new sfValidatorString(array('max_length' => 500, 'required' => false)),
      'prefixe_bon_sortie_interne'                  => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'compteur_bon_sortie_interne'                 => new sfValidatorInteger(array('required' => false)),
      'prefixe_bon_entree_interne'                  => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'compteur_bon_entree_interne'                 => new sfValidatorInteger(array('required' => false)),
      'prefixe_client'                              => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'prefixe_fournesseur'                         => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'prefixe_devis_client'                        => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'compteur_devis_client'                       => new sfValidatorInteger(array('required' => false)),
      'prefixe_bon_commande_client'                 => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'compteur_bon_commande_client'                => new sfValidatorInteger(array('required' => false)),
      'prefixe_bon_livraison_client'                => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'compteur_bon_livraison_client'               => new sfValidatorInteger(array('required' => false)),
      'prefixe_bon_retour_client'                   => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'compteur_bon_retour_client'                  => new sfValidatorInteger(array('required' => false)),
      'prefixe_facture_client'                      => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'compteur_facture_client'                     => new sfValidatorInteger(array('required' => false)),
      'prefixe_facture_retour_client'               => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'compteur_facture_retour_client'              => new sfValidatorInteger(array('required' => false)),
      'prefixe_preparation_livraison_client'        => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'compteur_preparation_livraison_client'       => new sfValidatorInteger(array('required' => false)),
      'prefixe_avoir_marchandise_client'            => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'compteur_avoir_marchandise_client'           => new sfValidatorInteger(array('required' => false)),
      'prefixe_reglement_client'                    => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'compteur_reglement_client'                   => new sfValidatorInteger(array('required' => false)),
      'prefixe_reglement_fournisseur'               => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'compteur_reglement_fournisseur'              => new sfValidatorInteger(array('required' => false)),
      'prefixe_bon_sortie_camion'                   => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'compteur_bon_sortie_camion'                  => new sfValidatorInteger(array('required' => false)),
      'prefixe_bon_retour_camion'                   => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'compteur_bon_retour_camion'                  => new sfValidatorInteger(array('required' => false)),
      'prefixe_bon_commande_fournisseur'            => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'compteur_bon_commande_fournisseur'           => new sfValidatorInteger(array('required' => false)),
      'prefixe_bon_retour_fournisseur'              => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'compteur_bon_retour_fournisseur'             => new sfValidatorInteger(array('required' => false)),
      'prefix_preparation_commande_fournisseur'     => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'compteur_preparation_commande_fournisseur'   => new sfValidatorInteger(array('required' => false)),
      'prefix_devis_client'                         => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'sequentiel_bon_sortie_interne'               => new sfValidatorInteger(array('required' => false)),
      'sequentiel_bon_entree_interne'               => new sfValidatorInteger(array('required' => false)),
      'sequentiel_devis_client'                     => new sfValidatorInteger(array('required' => false)),
      'sequentiel_bon_commande_client'              => new sfValidatorInteger(array('required' => false)),
      'sequentiel_bon_livraison_client'             => new sfValidatorInteger(array('required' => false)),
      'sequentiel_bon_retour_client'                => new sfValidatorInteger(array('required' => false)),
      'sequentiel_facture_client'                   => new sfValidatorInteger(array('required' => false)),
      'sequentiel_facture_retour_client'            => new sfValidatorInteger(array('required' => false)),
      'sequentiel_preparation_livraison_client'     => new sfValidatorInteger(array('required' => false)),
      'sequentiel_avoir_marchandise_client'         => new sfValidatorInteger(array('required' => false)),
      'sequentiel_bon_sortie_camion'                => new sfValidatorInteger(array('required' => false)),
      'sequentiel_bon_retour_camion'                => new sfValidatorInteger(array('required' => false)),
      'sequentiel_bon_retour_fournisseur'           => new sfValidatorInteger(array('required' => false)),
      'sequentiel_bon_commande_fournisseur'         => new sfValidatorInteger(array('required' => false)),
      'sequentiel_preparation_commande_fournisseur' => new sfValidatorInteger(array('required' => false)),
      'tarification'                                => new sfValidatorBoolean(array('required' => false)),
      'caisse'                                      => new sfValidatorBoolean(array('required' => false)),
      'id_categorie_comptable'                      => new sfValidatorInteger(array('required' => false)),
      'id_forme_juridique'                          => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('FormeJuridique'))),
      'id_nationalite'                              => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Nationalite'))),
      'id_devise'                                   => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Devise'), 'required' => false)),
      'created_at'                                  => new sfValidatorDateTime(),
      'updated_at'                                  => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('societe[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Societe';
  }

}
